
import javax.swing.JTextArea;

/**
 * <p>Title: Judging Tool</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author Sujal Bista
 * @version 1.0
 */
public class showOutput
{
    private JTextArea output;
    public showOutput(JTextArea output)
    {
        this.output=output;
    }

    public synchronized void printLn(String line)
    {
        if(output!=null)
            output.append(line+"\n");
        else
            System.out.println(line);
    }

    public synchronized void print(String line)
    {
        if(output!=null)
            output.append(line);
        else
            System.out.print(line);
    }

    public synchronized void error(String line)
    {
        if(output!=null)
            output.append("Error : "+line+"\n");
        else
            System.out.println("Error : "+line);
    }


}
